import request from '@/utils/request'

export function loginApi(data) {
  return request({
    url: '/login',
    method: 'post',
    data
  })
}

export function getInfoApi(params) {
  return request({
    url: '/user-info',
    method: 'get',
    params
  })
}

export function logoutApi() {
  return request({
    url: '/user-logout',
    method: 'post'
  })
}

// 添加用户
export function addUserApi(data) {
  return request({
    url: '/user',
    method: 'post',
    data
  })
}

// 删除用户
export function deleteUserApi(data) {
  return request({
    url: '/user',
    method: 'delete',
    data
  })
}

// 修改用户
export function updateUserApi(data) {
  return request({
    url: '/user',
    method: 'put',
    data
  })
}

// 获取用户列表
export function getUserApi(params) {
  return request({
    url: '/user/list',
    method: 'get',
    params
  })
}